package com.irdstudio.apicenter.gateway.web;

import java.util.ArrayList;
import java.util.List;

import com.irdstudio.apicenter.gateway.core.dm.AppTradeInout;

/**
 * 交易定义信息
 * 
 * @author guangming.li
 * @version 1.0
 * @date 2015-05-21
 */
public class MaccsTradeDefineVo {

	/* 交易唯一标识 */
	private String tradeId;
	/* 移动应用标识 */
	private String appId;
	/* 交易码 */
	private String tradeCode;
	/* 转发渠道标识 */
	private String forwardChannelId;
	/* 交易名称 */
	private String tradeName;
	/* 交易处理类 */
	private String tradeClass;
	/* 是否使用档板 */
	private boolean isUseBaffle;
	/* 交易档板数据 */
	private String tradeBaffleData;
	/* 是否检查会话令牌 */
	private boolean isCheckToken;
	/* 是否检查发起交易时的设备与登录时的设备一致 */
	private boolean isCheckDevice;
	/* 是否检查发起交易时的网络与登录时的网络一致 */
	private boolean isCheckNetwork;

	/* 交易报文输入要素*/
	private List<AppTradeInout> inList = null;
	
	/*交易报文输出要素 */
	private List<AppTradeInout> outList = null;

	public String getTradeId() {
		return tradeId;
	}

	public void setTradeId(String tradeId) {
		this.tradeId = tradeId;
	}

	public String getAppId() {
		return appId;
	}

	public void setAppId(String appId) {
		this.appId = appId;
	}

	public String getTradeCode() {
		return tradeCode;
	}

	public void setTradeCode(String tradeCode) {
		this.tradeCode = tradeCode;
	}

	public String getForwardChannelId() {
		return forwardChannelId;
	}

	public void setForwardChannelId(String forwardChannelId) {
		this.forwardChannelId = forwardChannelId;
	}

	public String getTradeName() {
		return tradeName;
	}

	public void setTradeName(String tradeName) {
		this.tradeName = tradeName;
	}

	public String getTradeClass() {
		return tradeClass;
	}

	public void setTradeClass(String tradeClass) {
		this.tradeClass = tradeClass;
	}

	/**
	 * 返回输入格式配置列表
	 * @return
	 */
	public List<AppTradeInout> getInList() {
		return inList;
	}
	
	/**
	 * 返回输出格式配置列表
	 * @return
	 */
	public List<AppTradeInout> getOutList() {
		return outList;
	}	

	public void setInoutList(List<AppTradeInout> inoutList) {
		if(inoutList != null && inoutList.size() > 0){
			this.inList = new ArrayList<AppTradeInout>();
			this.outList = new ArrayList<AppTradeInout>();
			for(AppTradeInout inout : inoutList){
				if("1".equals(inout.getTradeElementType())){
					inList.add(inout);
				} else {
					outList.add(inout);
				}
			}
		}
	}

	public void setUseBaffle(boolean isUseBaffle) {
		this.isUseBaffle = isUseBaffle;
	}

	public boolean isUseBaffle() {
		return isUseBaffle;
	}

	public void setTradeBaffleData(String tradeBaffleData) {
		this.tradeBaffleData = tradeBaffleData;
	}

	public String getTradeBaffleData() {
		return tradeBaffleData;
	}
	
	public boolean isCheckToken() {
		return isCheckToken;
	}

	public void setCheckToken(boolean isCheckToken) {
		this.isCheckToken = isCheckToken;
	}

	public boolean isCheckDevice() {
		return isCheckDevice;
	}

	public void setCheckDevice(boolean isCheckDevice) {
		this.isCheckDevice = isCheckDevice;
	}

	public boolean isCheckNetwork() {
		return isCheckNetwork;
	}

	public void setCheckNetwork(boolean isCheckNetwork) {
		this.isCheckNetwork = isCheckNetwork;
	}	
}
